const path = require('path')
module.exports = {
    chainWebpack: (config) => {
        config.module.rule('images')
            .test(/\.(gif|png|jpe?g|svg)$/i)
            .use('url-loader')
            .loader('url-loader')
            .options({
                name: 'img/[name].[hash:8].[ext]',
                esModule: false, // 这里设置为false
            })
            .end()
    },
    pluginOptions: {
        'style-resources-loader': {
            preProcessor: 'less',
            patterns: [path.resolve(__dirname, "./src/styles/vars.less")] // 引入全局样式变量
        }
    },
}